package com.jishuo.nontax.bean.vo;

import com.jishuo.base.util.StringObject;
import com.jishuo.nontax.bean.bank.ChargeBillDetail;
import com.jishuo.nontax.bean.message.SetChargeBillDetailDTO;
import com.jishuo.nontax.bean.message.SetChargeBillManualDetailDTO;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author hlp
 * @date 2023/2/6 13:36
 * @Description:
 */
@Data
public class ChargeBillDetailVO implements Serializable {
    private static final long serialVersionUID = 1L;

    //流水号
    private Long detailid;
    //缴款书流水号
    private Long billheadid;
    //项目编码流水号
    private Long fromitemid;
    //原始金额（票面金额）
    private BigDecimal originfund;
    //当前金额
    private BigDecimal currentfund;
    //数量
    private BigDecimal amount;
    //收费标准
    private String itemstandtype;
    //计量单位
    private String measureunit;
    //项目编码
    private String itemcode;
    //项目名称
    private String itemname;
    //细表项目流水号
    private Integer detailitemid;
    //细表项目编码
    private String detailitemcode;
    //细表项目名称
    private String detailitemname;
    //是否执收单位扩充项目	1：是，0：不是
    private Integer isextenditem;
    //省级分成金额
    private BigDecimal provincescale;
    //市级分成金额
    private BigDecimal cityscale;
    //以后扩展字段
    private String e03;
    //以后扩展字段
    private String e04;
    //以后扩展字段
    private String e05;

    public String __status;

    private String upperLimit;

    private String lowerLimit;

    private int isLimit;

    public ChargeBillDetailVO(SetChargeBillManualDetailDTO bean){
        this.billheadid = Long.valueOf(bean.getDetailid());
        this.fromitemid=Long.valueOf(bean.getFromitemid());
        this.itemstandtype=bean.getItemstandtype();
        this.itemcode = bean.getItemcode();
        this.itemname=bean.getItemname();
        this.measureunit=bean.getMeasureunit();
        this.originfund=new BigDecimal(bean.getOriginfund());
        this.currentfund=new BigDecimal(bean.getCurrentfund());
        this.provincescale=new BigDecimal(bean.getProvincescale());
        this.cityscale=new BigDecimal(bean.getCityscale());
        this.amount=new BigDecimal(bean.getAmount());
    }

    public ChargeBillDetailVO(SetChargeBillDetailDTO bean){
        this.fromitemid=Long.valueOf(bean.getFromitemid());
        this.originfund=new BigDecimal(bean.getOriginfund());
        this.provincescale = new BigDecimal(bean.getProvincescale());
        this.cityscale = new BigDecimal(bean.getCityscale());
        this.amount = new BigDecimal(bean.getAmount());
    }

    public ChargeBillDetail getChargeBillDetail(){
        ChargeBillDetail bean = new ChargeBillDetail();
        bean.setDetailid(StringObject.objectString(this.detailid));
        bean.setBillheadid(StringObject.objectString(this.billheadid));
        bean.setFromitemid(StringObject.objectString(this.fromitemid));
        bean.setOriginfund(StringObject.objectString(this.originfund));
        bean.setProvincescale(StringObject.objectString(this.provincescale));
        bean.setCityscale(StringObject.objectString(this.cityscale));
        bean.setAmount(StringObject.objectString(this.amount));
        bean.setItemcode(this.itemcode);
        bean.setItemname(this.itemname);
        return bean;
    }

    public ChargeBillDetailVO(){}

}
